<template>
  <div class="nav">
    <div class="wrapper">
      <div class="left">
        <img src="../assets/images2/1.png" alt="" />
      </div>
      <div class="center">
        <router-link to="/City"  tag="div">
          <div class="right">
            <strong>福州</strong>
            [更换]
          </div>
        </router-link>

        <div class="content">
          <div class="content-nav">
            <span  :class="this.flag?'active':''" @click="findTaoCan">搜套餐</span>
            <span   :class="this.flag?'':'active'" @click="findYiYuan">选医院</span>
          </div>
          <input type="text"  ref="input" :placeholder=dateinit  @focus="blurSearchFor" @blur="blurSear" />
          <span class="search">搜索</span>
        </div>
      </div>

    </div>
  </div>
</template>

<script>
export default {
  name: "VHeadertwo",
  data() {
    return {
      dateinit:'请输入您要搜索的套餐',
      flag:true
    }
  },
  methods: {
    findYiYuan() {
      // var input = this.$refs.input
      // input.innerText = '新文本内容'
      this.dateinit='请输入您要搜索的医院'
      this.flag=false

      
    },
    findTaoCan() {
      this.dateinit='请输入您要搜索的套餐'
      this.flag=true

    },
    blurSearchFor(){
      // console.log(this.placeholder)
      // if(this.placeholder!=''){
      //   this.placeholder='';
      // }
    },
    blurSear(){
      // console.log(this.placeholder)
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  div{
    color:#5d605c
  }
  strong{

  }

  .center{
    margin:0 auto;
    position: relative;
  }
  .left{
    position: absolute;
  }
.nav {
  height: 130px;
  min-width:1300px;
}
.wrapper {
  width: 80%;
  margin: 0 auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-width:1000px;
  height: 100%;
  position: relative;
}
.right {
  height: 40px;
  line-height: 40px;
  border: 1px solid gainsboro;
  padding: 0 10px;
  cursor:pointer;
  position: absolute;
  left: -139px;
  top:40px;

}
.content {
  margin:0 auto;

}
input {
  height: 35px;
  width: 400px;
  margin: 0 auto;
}
  span{
    border:1px solid gainsboro;
    padding:5px  15px;
    font-family: Arial;
    font-size: 14px;
    float:left;
    line-height: 18px;
    margin-right:3px;
    margin-bottom:-1px;
    margin-left:-1px;

  }
  input{
    border:1px solid #00BFFF;
    border-right: none;
    margin-right:-6px;
    float:left;
    line-height: 18px;
    padding-left:14px;
  }
  .search{
    width:60px;
    height:25px;
    background-color: #00BFFF;
    color:#fff;
    display:inline-block;
    text-align: center;
    float:left;
    line-height: 25px;
    cursor:pointer;
    border:1px solid #00bfff;

    /*-webkit-user-select: none;*/
  }
  .content-nav{
    margin-top:20px;
    cursor:pointer;
  }
input::-ms-input-placeholder {
  text-align: left;
  left:5px;
}

input::-webkit-input-placeholder {
  text-align: left;
  left:5px;

}
  .active{
    background-color:#00BFFF;
    color:#fff;
  }

</style>
